package com.yuncheng.spcyApi.config;

import io.minio.MinioClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Minio 配置类
 */
 @Configuration
 @ConfigurationProperties(prefix = "spcy.minio")
 public class SpcyMinioConfig {

 private String minio_url;
 private String minio_name;
 private String minio_pass;
 private String bucketName;

    @Bean
    public MinioClient minioClient() {
        return MinioClient.builder()
             .endpoint(minio_url)
                .credentials(minio_name, minio_pass)
                .build();
    }

    public String getMinio_url() {
        return minio_url;
    }

    public void setMinio_url(String minio_url) {
        this.minio_url = minio_url;
    }

    public String getMinio_name() {
        return minio_name;
    }

    public void setMinio_name(String minio_name) {
        this.minio_name = minio_name;
    }

    public String getMinio_pass() {
        return minio_pass;
    }

    public void setMinio_pass(String minio_pass) {
        this.minio_pass = minio_pass;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }
 }

